home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: Special XP & Vista
/
Chip Spesial XP & Vista.iso
/
1_Audio_Video
/
MediaCell_Mobile_Video_Converter
/
MediaCellMobileVideoConverterSetupFull.exe
/
vm.htj
< prev
Wrap
Text File
|
2006-09-21
|
20KB
|
702 lines
/*
** SimuSelect Code
*/
var lastOpenSS = '';
var ssIsIE = (navigator.appName=="Microsoft Internet Explorer");
function SimuSelect(selectObject, isCombo)
{
var oVal, oLabel, htmlCode='', selectName, i, simuSelObject;
// If we are passed an actual object, let's get it's HTML directly
if (selectObject && selectObject.type && selectObject.type.search(/select/i)==0)
htmlCode = selectObject.innerHTML;
else
{
alert("SimuSelect() : Not a valid SELECT object.");
return;
}
// Parse the <SELECT> block.
if (htmlCode.search(/<select/i) >= 0)
{
alert("SimuSelect() : Nested <select> blocks not supported.");
return;
}
selectObject.origVisibility = (selectObject.style.visibility) ? selectObject.style.visibility : "visible";
selectObject.style.visibility = "hidden";
// Rename the Select Object so we can use this name in our new object
selectName = "ss_"+ selectObject.name;
// Special box for Drop Down
if (ssIsIE)
boxClass = "boxClass";
else
boxClass = "boxClassGecko";
var simuContainer = document.createElement("span");
simuContainer.id = "__"+ selectName;
simuContainer.className = "simuSelect";
// Generate a Combo Select / Input box
simuContainer.innerHTML =
'<input name="_'+ selectName +'" id="_'+ selectName +'" class="simuSelectInput" ondblclick="if (window.lastOpenSS) closeSS()"'
+ ((isCombo) ? '' : ' onmousedown="openSS(\''+ selectName +'\')" style="cursor:default"')
+' onmouseover="document.getElementById(\'drop\'+ this.id).className=\'dropSquare-hi\'"'
+' onmouseout="document.getElementById(\'drop\'+ this.id).className=\'dropSquare\'"'
+' type="text" value="'+ ((selectObject.selectedIndex > -1) ? selectObject.options[selectObject.selectedIndex].text : '') +'">'
+'<input class="'+ boxClass +'" UNSELECTABLE="on" tabindex="-1" onfocus="blur()" readonly>'
+'<span id="drop_'+ selectName +'" class="dropSquare" UNSELECTABLE="on" ondblclick="openSS(\''+ selectName +'\')"'
+' onmouseover="this.className=\'dropSquare-hi\'" onmouseout="this.className=\'dropSquare\'"'
+' onmousedown="this.className=\'dropSquare-on\';openSS(\''+ selectName +'\');return false"'
+' onmouseup="this.className=\'dropSquare\';return false">▼</span>';
selectObject.parentNode.appendChild(simuContainer);
// Generate the Options drop down box
document.writeln('<DIV id="'+ selectName +'" style="OVERFLOW: auto; WIDTH: 166px; HEIGHT: 100px" class="simuSelDrop" onblur="closeSS(\''+ selectName +'\')">'
+'<TABLE cellSpacing=1 cellPadding=0 border=0 bgcolor="black"><TBODY><TR><TD>'
+'<TABLE id="opt_'+ selectName +'" cellSpacing=0 cellPadding=2 width="100%" border=0><TBODY>');
window.origDocOnFocus = document.onfocus;
document.onfocus = new Function("if (window.lastOpenSS) closeSS();if (window.origDocOnFocus) eval(window.origDocOnFocus);return true;");
simuSelObject = document.getElementById('_'+ selectName);
var oSelStyle = (window.getComputedStyle) ? getComputedStyle(selectObject, null) : selectObject.currentStyle;
simuSelObject.style.color = oSelStyle.color;
simuSelObject.onkeydown = ssCheckKB;
document.getElementById(selectName).onkeydown = ssCheckKB;
simuSelObject.isCombo = isCombo;
simuSelObject.origSelect = selectObject;
simuSelObject.options = new Array();
oIndex = 0;
if (isCombo)
{
if (selectObject.onchange)
simuSelObject.onchange = new Function("execChangeEvt(document.getElementById('_"+ selectName +"').origSelect);");
}
else
simuSelObject.readOnly = true;
document.writeln('</TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>\n');
// If the <SELECT> has no options, make it invisible
if (selectObject.options.length < 1)
simuContainer.style.visibility = "hidden";
// Create a positional element to get the position of the original Select
posEl=document.createElement("SPAN");
posEl.id = "pos_"+ selectName;
posEl.style.position ="relative";
posEl.innerHTML = " ";
selectObject.parentNode.insertBefore(posEl,selectObject);
simuContainer.style.visibility = selectObject.origVisibility;
simuSelObject.onkeydown=null;
simuSelObject=null;
simuContainer=null;
posEl=null;
ssSyncOptions(selectObject);
setTimeout("ssResize('"+ selectName +"')", 20);
}
// Resizes the SimuSelect control per the attributes of the original select
function ssResize(selectName, isUpdate)
{
var simuSelObject = document.getElementById('_'+ selectName);
var simuContainer = document.getElementById('__'+ selectName);
var posElement = document.getElementById('pos_'+ selectName);
var tableNode = document.getElementById('opt_'+ selectName);
simuSelObject.style.width = Math.abs(parseInt(tableNode.offsetWidth) - document.getElementById('drop_'+ selectName).offsetWidth + 2);
simuContainer.style.left = 1 * ((posElement.clientLeft) ? posElement.clientLeft : 0) + posElement.offsetLeft;
simuContainer.style.top = -4 + ((posElement.clientTop) ? posElement.clientTop : 0) + posElement.offsetTop;
simuContainer.style.textAlign="left";
// Sync the style of the options based on the run-time style of the original select options
var oOptStyle = (window.getComputedStyle) ? getComputedStyle(simuSelObject.origSelect, null) : simuSelObject.origSelect.currentStyle;
var rules;
for(var si=0; si < document.styleSheets.length; si++)
{
rules = (document.styleSheets[si].cssRules) ? document.styleSheets[si].cssRules : document.styleSheets[si].rules;
if (rules && rules.length)
for(var ri=0; ri < rules.length; ri++)
if (rules[ri] && rules[ri].selectorText.search(/^\.simuSelNormal$/i)==0)
{
if (oOptStyle.color)
rules[ri].style.color = oOptStyle.color;
}
}
}
// Called to hide the SimuSelect object
function ssHide(selectObject)
{
if (!selectObject || typeof(selectObject) != "object")
{
alert("ssSyncOptions() : Not a valid SELECT object.");
return;
}
document.getElementById('__ss_'+ selectObject.name).style.visibility = "hidden";
}
// This function needs to get called to synchronize any dynamically updated <SELECT> controls
// with the SimuSelect control (when dynamically adding/removing options).
function ssSyncOptions(selectObject)
{
var tableNode, selectName, i, simuSelObject;
if (!selectObject || typeof(selectObject) != "object")
{
alert("ssSyncOptions() : Not a valid SELECT object.");
return;
}
selectName = "ss_"+ selectObject.name;
simuSelObject = document.getElementById('_'+ selectName);
tableNode = document.getElementById('opt_'+ selectName);
// See if the original select was un-hidden
var curVisibility = (selectObject.style.visibility) ? selectObject.style.visibility : "visible";
if (selectObject.origVisibility != "hidden" || curVisibility != "hidden")
{
selectObject.style.visibility = "hidden";
if (document.getElementById('__'+ selectName))
document.getElementById('__'+ selectName).style.visibility = "visible";
}
// Rewrite the DHTML dynamically with the most current options
simuSelObject.options = new Array();
simuSelObject.lastHighlighted = -1;
var newTBody = document.createElement('tbody');
var oldTBody = tableNode.childNodes[0];
var oTR, oTD, oTDspan;
for(i=0; i < selectObject.options.length; i++)
{
simuSelObject.options[i] = new Option();
simuSelObject.options[i].value = selectObject.options[i].value;
simuSelObject.options[i].text = selectObject.options[i].text;
oTR = document.createElement('tr');
newTBody.appendChild(oTR);
oTD = document.createElement('td');
oTD.id = "o"+ i +"_"+ selectName;
oTD.style.whiteSpace = "noWrap";
oTD.className = "simuSelNormal";
oTD.onmouseover = new Function("ssHighlightOption('"+ selectName +"',"+ i +")");
oTD.onmouseup = new Function("setSelect('"+ selectName +"',"+ i +")");
oTD.onmousedown = oTD.onmouseup;
oTD.appendChild(document.createTextNode(simuSelObject.options[i].text));
oTDspan = document.createElement('span');
oTDspan.style.width = "21px";
oTDspan.style.paddingLeft = "21px";
oTDspan.innerHTML = " "
oTD.appendChild(oTDspan);
oTR.appendChild(oTD);
}
tableNode.replaceChild(newTBody, oldTBody);
oTD=null;
oTR=null;
oTDspan=null;
newTBody=null;
setTimeout("ssResize('"+ selectName +"')", 20);
var currSelIdx = (selectObject.selectedIndex > -1) ? selectObject.selectedIndex : 0;
setSelect(selectName, currSelIdx, true);
}
// Highlight the option on Mouse Over
function ssHighlightOption(ssID, idx)
{
var ss = document.getElementById('_'+ssID);
var so = document.getElementById('o'+ idx +'_'+ ssID);
// Un-Highlight the last item, otherwise un-highlight all
if (ss.lastHighlighted > -1)
document.getElementById('o'+ ss.lastHighlighted +'_'+ ssID).className = "simuSelNormal";
else
for(var i=0; i < ss.options.length; i++)
document.getElementById('o'+ i +'_'+ ssID).className = "simuSelNormal";
so.className = "simuSelSelected";
ss.lastHighlighted = idx;
}
function openSS(ssID)
{
var ss = document.getElementById(ssID)
if (ss)
{
if (lastOpenSS)
{
closeSS(lastOpenSS);
return;
}
if(!ss.posDone)
{
var simuContainer = document.getElementById('__'+ ssID);
ss.style.left = simuContainer.offsetLeft + 1;
ss.style.top = simuContainer.offsetTop + simuContainer.offsetHeight;
ss.posDone = true;
}
ss.style.zIndex = 100;
ss.style.visibility = 'visible';
if (ssIsIE)
ss.focus();
else
document.getElementById('_'+ ssID).focus();
// Highlight the selected item
var ss = document.getElementById('_'+ssID);
if (ss.selectedIndex > -1 && ss.options[ss.selectedIndex].text == ss.value)
ssHighlightOption(ssID, ss.selectedIndex)
}
lastOpenSS = ssID;
}
function closeSS(ssID)
{
var menuObj;
if (ssID)
menuObj = document.getElementById(ssID);
else if (lastOpenSS)
{
ssID = lastOpenSS
menuObj = document.getElementById(ssID);
}
if (menuObj)
{
menuObj.style.visibility = 'hidden';
menuObj.style.zIndex = 0;
lastOpenSS = '';
document.getElementById('_'+ssID).lastHighlighted = -1;
}
setTimeout("document.getElementById('_"+ ssID +"').select()",10);
}
function setSelect(ssID, newIndex, isOnSync, leaveOpen)
{
if (!leaveOpen) closeSS(ssID);
var ss = document.getElementById('_'+ssID);
var so = document.getElementById('o_'+ssID);
var isChanged = (ss.origSelect.selectedIndex != newIndex);
ss.origSelect.selectedIndex = newIndex;
ss.selectedIndex = newIndex;
ss.value = (ss.options[newIndex]) ? ss.options[newIndex].text : "";
// If the original select had an onchange event, process it
if (!isOnSync && isChanged && ss.origSelect.onchange)
execChangeEvt(ss.origSelect);
if (!isOnSync && (!leaveOpen || !lastOpenSS)) setTimeout("document.getElementById('_"+ ssID +"').select()",10);
}
// Sends an onchange event to an object
function execChangeEvt(selObj)
{
if (selObj.fireEvent)
selObj.fireEvent("onchange");
else if (document.createEvent)
{
var ev = document.createEvent('Events');
ev.initEvent("change", false, false);
selObj.dispatchEvent(ev);
}
}
// Go through the Forms of the current page and REPLACE all <SELECT> controls with SimuSelect controls.
function SimuSelectAll()
{
var i,j, ele;
for(i=0; i < document.forms.length; i++)
{
for(j=0; j < document.forms[i].length; j++)
{
ele = document.forms[i].elements[j];
if(ele.type.indexOf("select") >= 0 )
{
SimuSelect(ele, true);
}
}
}
}
// Support keyboard shortcuts for the SimuSelect contols
function ssCheckKB(ev)
{
if (!ev) ev = window.event;
if (ev)
{
var sourceObj = (ev.srcElement) ? ev.srcElement : ev.target;
if (!sourceObj) return true;
var ssID = sourceObj.id.replace(/^_/,"");
var ss = document.getElementById('_'+ssID);
var kc = ev.keyCode;
var key = String.fromCharCode(kc);
var newIndex = (ss.lastHighlighted > -1) ? ss.lastHighlighted : ss.selectedIndex;
if (kc == 27) // Escape
closeSS(lastOpenSS);
else if (kc == 38) // Up
{
if ((newIndex-1) >= 0)
newIndex--;
if (lastOpenSS)
ssHighlightOption(ssID, newIndex);
setSelect(ssID, newIndex, false, true);
}
else if (kc == 40) // Down
{
if ((newIndex+1) < ss.options.length)
newIndex++;
if (lastOpenSS)
ssHighlightOption(ssID, newIndex);
setSelect(ssID, newIndex, false, true);
}
else if (kc == 36 || kc == 33) // Home / PgUp
{
newIndex = 0;
if (lastOpenSS)
ssHighlightOption(ssID, newIndex);
setSelect(ssID, newIndex, false, true);
}
else if (kc == 35 || kc == 34) // End / PgDn
{
newIndex = ss.options.length - 1;
if (lastOpenSS)
ssHighlightOption(ssID, newIndex);
setSelect(ssID, newIndex, false, true);
}
else if (key.search(/^[A-Za-z0-9]$/) == 0) // Letter / Number
{
if (ss.isCombo)
return true;
// Find the next option that starts with this letter/number
var i = newIndex + 1;
do
{
if (i >= ss.options.length)
if (newIndex == 0)
break;
else
i = 0;
if (ss.options[i].text && key.toLowerCase() == ss.options[i].text.charAt(0).toLowerCase())
{
if (lastOpenSS)
ssHighlightOption(ssID, i);
setSelect(ssID, i, false, true);
break;
}
i++;
}
while(i != newIndex);
}
}
return true;
}
// END SimuSelect
/*
** DHTML File Menus
**
** Based on sources at http://dhtmlmenus.editthispage.com/ by Jake Savin
*/
var menuEventList = new Array(1);
menuEventList[0] = 0;
var uniqueEventIdentifier = 1;
function menuEvent (secs, exeStatement)
{
cancelMenuEvent ();
this.time = secs;
this.exeStatement = exeStatement;
this.identifier = uniqueEventIdentifier++;
menuEventList[0] = this;
window.setTimeout ( "executemenuEvent(" + menuEventList[0].identifier + ");", secs*1000 );
}
function executemenuEvent (eventIdentifier)
{
if ( typeof ( menuEventList[0] ) == "object" )
if ( typeof ( menuEventList[0].exeStatement ) == "string" )
if ( menuEventList[0].identifier == eventIdentifier )
{
eval ( menuEventList[0].exeStatement );
menuEventList[0] = void 0;
}
}
function cancelMenuEvent ()
{
menuEventList[0] = void 0;
}
function menuBarMouseOut ()
{
}
function menuBarBlur ()
{
if (document.currentMenu)
document.currentMenu.style.display='none';
if (document.currentMBarOpt)
document.currentMBarOpt.style.border='1px solid #eCeCe2';
document.menuIsActive = false;
window.menuHasFocus = false;
}
function menuBarOptionMouseOver (menuBarOptionId, menuId) {
if (document.menuIsActive) {
if (document.currentMenu)
document.currentMenu.style.display = 'none';
document.currentMBarOpt.style.border='1px solid #eCeCe2';
document.currentMBarOpt.style.backgroundColor='#eCeCe2';
document.currentMBarOpt.style.color='black';
}
if (document.menuIsActive) {
menuBarOptionId.style.border='1px buttonface inset';
menuId.style.display = 'block';
}
else {
if (typeof (document.currentMBarOpt) == 'object') {
document.currentMBarOpt.style.border='1px solid #eCeCe2';
}
menuBarOptionId.style.border='1px buttonface outset';
}
menuBarOptionId.style.cursor='default';
if (document.currentMenu)
document.currentMenu=menuId;
document.currentMBarOpt=menuBarOptionId;
window.menuHasFocus = true;
}
function menuBarOptionMouseOut (menuBarOptionId)
{
menuBarOptionId.style.border='1px solid #eCeCe2';
window.menuHasFocus = false;
}
function menuBarOptionMouseDown (menuBarOptionId, menuId) {
menubar.focus ();
menuBarOptionId.style.border='1px buttonface inset';
menuId.style.display = 'block';
document.menuIsActive=true;
}
function menuClick ()
{
}
function menuOptionCellMouseOver (cell)
{
cell.style.cursor='default';
cell.style.color='white';
cell.style.backgroundColor='#0066BB';
}
function menuOptionCellMouseOut (cell)
{
cell.style.backgroundColor='#eCeCe2';
cell.style.color='black';
}
function menuOptionDivMouseDown (url)
{
if (document.currentMenu)
document.currentMenu.style.display='none';
document.currentMBarOpt.style.border='1px solid #eCeCe2';
document.menuIsActive = false;
window.menuHasFocus = false;
if (url.search(/javascript:/) == 0)
eval(url.substr(11));
else
window.location=url;
}
function menuOptionDivClick (url)
{
}
// Support keyboard shortcuts for the file menu
function checkShorts()
{
var ev = window.event;
if (ev)
{
var key = String.fromCharCode(ev.keyCode);
if (ev.keyCode == 18) // ALT
{
if (document.menuIsActive || menuHasFocus)
{
//menuBarBlur();
lastAlt = false;
ev.returnValue = false;
}
else
{
//document.currentMenu=fileMenu;
//menuBarOptionMouseOver(fileMenuMBarOpt, fileMenu);
lastAlt = true;
ev.returnValue = false;
}
}
else if (ev.keyCode == 27) // Escape
menuBarBlur();
else if (ev.altKey || lastAlt)
{
if (key == 'F')
{
//menuBarBlur();
//document.currentMenu=fileMenu;
//document.currentMBarOpt=fileMenuMBarOpt;
//menuBarOptionMouseDown (fileMenuMBarOpt, fileMenu);
lastAlt = false;
}
else if (key == 'H')
{
//menuBarBlur();
//document.currentMenu=helpMenu;
//document.currentMBarOpt=helpMenuMBarOpt;
//menuBarOptionMouseDown (helpMenuMBarOpt, helpMenu);
lastAlt = false;
}
else if (key == 'S')
{
//menuBarBlur();
//document.currentMenu=settingsMenu;
//document.currentMBarOpt=settingsMenuMBarOpt;
//menuBarOptionMouseDown (settingsMenuMBarOpt, settingsMenu);
lastAlt = false;
}
}
else if (key == 'O' && document.currentMenu == fileMenu)
{
if (document.menuIsActive)
menuOptionDivMouseDown('javascript:popFileOpen()');
}
else if (key == 'X' && document.currentMenu == fileMenu)
{
if (document.menuIsActive)
menuOptionDivMouseDown('javascript:window.close()');
}
else if (key == 'S' && document.currentMenu == settingsMenu)
{
if (document.menuIsActive)
menuOptionDivMouseDown('javascript:window.saveConfig()');
}
else if (key == 'A' && document.currentMenu == helpMenu)
{
if (document.menuIsActive)
menuOptionDivMouseDown('javascript:about()');
}
}
}
/*
** Video Player
*/
var isPlayerDone = false;
var isPlayerPaused = false;
var isPlayerMuted = false;
var isPlayerStopped = true;
var whichPlayerInitializing = null;
function outpPlayPause()
{
playPause(document.Player2);
}
function inpPlayPause()
{
playPause(document.Player1);
}
function playPause(pObj)
{
if (isPlayerStopped)
pObj.URL= (ff.vFile.value) ? ff.vFile.value : "";
else if (isPlayerPaused)
pObj.controls.play();
else
pObj.controls.pause();
}
function playerLoad(pObj, url)
{
if (!pObj) return;
pObj.URL = url;
whichPlayerInitializing = pObj;
//pObj.controls.stop();
}
function toggleActive(pObj)
{
if (pObj)
{
if (pObj.enabled)
{
pObj.enabled=false;
pObj.uiMode="invisible";
}
else
{
pObj.enabled=true;
pObj.uiMode="full";
if (ff.vFile.value)
playerLoad(pObj, ff.vFile.value);
}
}
}
function inpStop()
{
document.Player1.controls.stop();
}
function inpFullScreen()
{
document.Player1.fullScreen = true;
}
function inpMute()
{
if (!isPlayerStopped)
{
isPlayerMuted = !isPlayerMuted;
document.Player.settings.mute = isPlayerMuted;
}
}
// END VIDEO PLAYER